import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/l10n.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:finance_app/src/widgets/bottom_sheet/default_info_bottom_sheet.dart';
import 'package:finance_app/src/widgets/button/normal_button.dart';
import 'package:flutter/material.dart';

/// 照片不清晰
showPhotoNoClearInfoBottomSheet(BuildContext context,
        {VoidCallback onRetake, VoidCallback onContinue}) =>
    showDefaultInfoBottomSheet(context,
        child: PhotoNoClearInfo(
          onContinue: onContinue,
          onRetake: onRetake,
        ));

class PhotoNoClearInfo extends StatelessWidget {
  final VoidCallback onRetake;
  final VoidCallback onContinue;

  const PhotoNoClearInfo({Key key, this.onRetake, this.onContinue})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisSize: MainAxisSize.min,
      children: [
        SizedBox(
          height: getDp(20),
        ),
        Text(
          S.current.the_photo_taken_is_not_clear,
          style: TextStyle(
            color: aceBlackColor,
            fontSize: getSp(22),
            fontWeight: FontWeight.w700,
            height: 24 / 22,
          ),
        ),
        SizedBox(
          height: getDp(19),
        ),
        Text(
          S.current
              .retake_the_photo_to_ensure_that_information_is_captured_accurately,
          textAlign: TextAlign.center,
          style: TextStyle(
            color: aceBlackColor,
            fontSize: getSp(16),
            fontWeight: FontWeight.w400,
            height: 22 / 16,
          ),
        ),
        SizedBox(
          height: getDp(30),
        ),
        NormalButton(
          title: S.current.retake_photo,
          onTap: onRetake,
        ),
        SizedBox(
          height: getDp(10),
        ),
        PressedOpacityButton(
          onPressed: onContinue,
          padding: EdgeInsets.symmetric(
            vertical: getDp(10),
            horizontal: getDp(10),
          ),
          child: Text(
            S.current.continue_anyway,
            style: TextStyle(
              color: aceBlueColor,
              fontSize: getSp(16),
              fontWeight: FontWeight.w700,
              height: 20 / 16,
            ),
          ),
        ),
      ],
    );
  }
}
